package com.open.source.kafka;

import com.alibaba.fastjson.JSON;
import com.open.source.kafka.interceptor.KafkaProducerListener;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import org.apache.kafka.clients.admin.NewTopic;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.protocol.types.Field.Str;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.kafka.core.KafkaAdmin;
import org.springframework.kafka.core.KafkaTemplate;

/**
 * @author ZonLen since on 2022/7/29 下午12:19
 */
@SpringBootApplication
public class KafkaProductApplication {

  public static void main(String[] args) throws InterruptedException {
    final ConfigurableApplicationContext context = SpringApplication
        .run(KafkaProductApplication.class, args);
    final KafkaTemplate<String, String> bean = context.getBean(KafkaTemplate.class);
    bean.setProducerListener(new KafkaProducerListener());

  }
}
